<script setup>
  import { ref } from "vue"
  import Products from "./products/index.vue"
  import Network from "./network/index.vue"
  import Resources from "./resources/index.vue"
  import UseCases from "./use_cases/index.vue"

  const aboutRef = ref(null)
  const productsRef = ref(null)
  const networkRef = ref(null)
  const resourcesRef = ref(null)
  const useCasesRef = ref(null)

  const scrollToAnchor = (refS) => {
    if (refS) {
      refS.scrollIntoView({ behavior: 'smooth' })
    }
  }
</script>

<template>
  <div class="big_content_box">
    <div ref="aboutRef" class="banner">
      <div class="title">
        <div class="left">
          <img src="@/assets/images/w_logo.jpg" alt="">
        </div>
        <div class="right">
          <div @click="scrollToAnchor(aboutRef)">About</div>
          <div @click="scrollToAnchor(productsRef)">Products</div>
          <div @click="scrollToAnchor(networkRef)">Network</div>
          <div @click="scrollToAnchor(resourcesRef)">Resources</div>
          <div @click="scrollToAnchor(useCasesRef)">Use Cases</div>
        </div>
      </div>
      <div class="content">
        <div class="name wow animate__animated animate__fadeInUp">ZKCross</div>
        <div class="text wow animate__animated animate__fadeInUp">
          <div>Revolutionizing <span class="web3">Web3</span> With <span>ZkWASM</span></div>
          <div>Fast, Flexible, And On-Chain Verifiable</div>
          <div>DApps</div>
        </div>
        <div class="des wow animate__animated animate__fadeInUp">
          <div>ZKCross provides an easy to use framework for developers to make their dApp built-</div>
          <div>in with zk technology. With ZKCross solution, dApp can be proved through zkp, verified</div>
          <div>on-chain via zkp and proof will be available in DA solutions.</div>
        </div>
      </div>
    </div>
    <div class="roll_item" ref="productsRef">
      <Products />
    </div>
    <div class="roll_item" ref="networkRef">
      <Network />
    </div>
    <div class="roll_item" ref="resourcesRef">
      <Resources />
    </div>
    <div class="roll_item" ref="useCasesRef">
      <UseCases />
    </div>
  </div>
</template>

<style scoped lang="scss">
.big_content_box {
  width: 100%;
  background-color: #fff;
  padding: 10px;
  box-sizing: border-box;
  .roll_item {
    width: 100%;
    padding: 10px 0px;
    box-sizing: border-box;
    margin-top: 80px;
    min-height: 200px;
  }
  .banner {
    width: 100%;
    height: calc(100vh - 20px);
    border-radius: 33px 33px 33px 33px;
    position: relative;
    display: flex;
    justify-content: center;
    background-image: url('@/assets/images/banner.gif');
    background-color: rgba(0,0,0, 0.69);
    background-repeat: no-repeat;
    background-size: cover; /* 背景图片覆盖元素 */
    background-position: center center; /* 背景图片居中 */
    background-blend-mode: multiply;
    min-height: 550px;
    .content {
      position: absolute;
      margin-top: 13%;
      div {
        text-align: center;
      }
      .name {
        color: #fff;
        font-weight: bold;
        font-size: 55px;
        line-height: 1;
      }
      .des {
        color: #fff;
        font-size: 20px;
        font-weight: 400;
        margin-top: 70px;
        line-height: 30px;
      }
      .text {
        font-weight: 400;
        font-size: 55px;
        color: #FFFFFF;
        line-height: 71px;
        margin-top: 10px;
        span {
          color: #BDDFFF;
        }
        .web3 {
          font-style: italic;
        }
      }
    }
    .title {
      position: absolute;
      padding: 0px 80px;
      top: 58px;
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      box-sizing: border-box;
      .left {
        img {
          width: 35px;
          height: 35px;
        }
      }
      .right {
        display: flex;
        color: #fff;
        font-size: 14px;
        font-weight: 400;
        div {
          margin-left: 56px;
          cursor: pointer;
        }
      }
    }
  }
}
</style>
